using Warehouse.Dto;

namespace Warehouse.Services.IServices
{
    /// <summary>
    /// 调拨单服务接口
    /// </summary>
    public interface IAllocationService
    {
        /// <summary>
        /// 创建调拨单
        /// </summary>
        Task<CreateAllocationResponse> CreateAllocationAsync(CreateAllocationRequest request);

        /// <summary>
        /// 获取调拨单列表
        /// </summary>
        Task<List<AllocationQueryDto>> GetTransferListAsync(int pageIndex = 1, int pageSize = 20);

        /// <summary>
        /// 获取调拨单详情
        /// </summary>
        Task<AllocationQueryDto?> GetTransferDetailAsync(int transferId);

        /// <summary>
        /// 获取调拨单明细
        /// </summary>
        Task<List<AllocationLineQueryDto>> GetTransferLinesAsync(int transferId);

        /// <summary>
        /// 检查库存是否充足
        /// </summary>
        Task<bool> CheckStockAsync(int productId, int warehouseId, int? locationId, decimal requiredQty);

        /// <summary>
        /// 获取商品库存
        /// </summary>
        Task<decimal> GetProductStockAsync(int productId, int warehouseId, int? locationId = null);

        /// <summary>
        /// 调拨出库
        /// </summary>
        Task<TransferOutResponse> TransferOutAsync(TransferOutRequest request);

        /// <summary>
        /// 调拨入库
        /// </summary>
        Task<TransferInResponse> TransferInAsync(TransferInRequest request);

        /// <summary>
        /// 获取调拨出库记录
        /// </summary>
        Task<List<TransferOutRecordDto>> GetTransferOutRecordsAsync(int transferId);

        /// <summary>
        /// 获取调拨入库记录
        /// </summary>
        Task<List<TransferInRecordDto>> GetTransferInRecordsAsync(int transferId);

        /// <summary>
        /// 获取调拨操作日志
        /// </summary>
        Task<List<TransferOpLogDto>> GetTransferOpLogsAsync(int transferId);
    }
}

